import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
/* Layout */
import layout from '../views/layout/Layout'


/**
 * 这是储罐对应的页面
 */
import chuGuanToCloud from "./modules/chuguan/dataToCloud"                         //数据上云
import chuGuanDataWarehouse from "./modules/chuguan/dataWarehouse"                 //数据仓储
import chuGuanDataEngine from "./modules/chuguan/dataEngine"                       //数据引擎
//import chuGuanUserCloudService from "./modules/chuguan/dataCloudService"           //数云服务
import chuGuanCheckCloudService from "./modules/chuguan/checkCloudService"
import chuGuanUserCloudService from "./modules/chuguan/userCloudService"
import chuGuanRegulatorCloudService from "./modules/chuguan/regulatorCloudService"
import chuGuanMakeCloudService from "./modules/chuguan/makeCloudService"



import serviceRouter from './modules/service'
import dataOperation from './modules/dataAnalyzation'
import dataEngine from './modules/dataEngine'
import monitoringOverview from './modules/monitoringOverview'
import dataToCloud from './modules/dataToCloud'
import {qzjDataTest,ydqpDataTest,yycgDataTest,dzglDataTest,dqkgDataTest} from './modules/dataTest'
import qipingDataToCloud from './modules/qiping/dataToCloud'
import qipingDataWarehouse from './modules/qiping/dataWarehouse'
import qipingDataEngine from './modules/qiping/dataEngine'
import qipingDataService from './modules/qiping/dataService'

import dianqiguiDataToCloud from './modules/dianqigui/dataToCloud'
import dianqiguiDataWarehouse from './modules/dianqigui/dataWarehouse'
import dianqiguiDataEngine from './modules/dianqigui/dataEngine'
import dianqiguiErrorWarning from "./modules/dianqigui/ErrorWarning";

import guoluDataToCloud from './modules/guolu/DataToCloud'
import guoluDataWarehouse from './modules/guolu/DataWarehouse'
import guoluDataEngine from './modules/guolu/DataEngine'
import guoluDataCloudService from './modules/guolu/dataCloudService'
import guolujgbm from  "./modules/guolu/jgbm"
import guolujyjg from  "./modules/guolu/jyjg"
import guolusydw from  "./modules/guolu/sydw"
import guoluzzdw from  "./modules/guolu/zzdw"
import jjtState from './modules/diagnosis'
export const constantRouterMap = [
  {
    path: '',
    component: layout,
    redirect: '/index',
    name: 'Index',
    equType:'all',
    children: [{
      path: 'index',
      meta: { title: '首页', icon: 'dashboard' },
      component: () => import('@/views/modules/dashboard/homepage')
    }]
  },
  { path: '/login', component: () => import('@/views/modules/login/index'), hidden: true },
  { path: '/404', component: () => import('@/views/404'), hidden: true },
  { path: '/auth/user/register', component: () => import('@/views/modules/auth/user/register'), hidden: true },
  { path: '/auth/user/resetpwd', component: () => import('@/views/modules/auth/user/register'), hidden: true }
]

export var asyncRouterMap = [
  // 起重机部分
  // deviceOverview, // 设备概览
  dataToCloud, // 数据上云
  qzjDataTest, // 数据测试
  dataOperation, // 数据仓储
  dataEngine, // 数据引擎
  ...serviceRouter, // 云服务总览

  // 气瓶部分
  qipingDataToCloud, // 数据上云
  ydqpDataTest,
  qipingDataWarehouse, // 数据仓储
  qipingDataEngine, // 数据引擎
  ...qipingDataService, // 数云服务
  
  // 空白跳转页面
  {path:'/reload:to',name:'reload',component:()=>import('@/views/modules/qiping/ReloadPage/Reload'),hidden:true},

  /**
   * 储罐部分的侧边导航按钮
   */
  chuGuanToCloud,                                                        //数据上云界面
  yycgDataTest,
  chuGuanDataWarehouse,                                                  //数据仓储界面
  chuGuanDataEngine,                                                     //数据引擎界面
  //chuGuanDataCloudService,                                             //数云服务界面
  chuGuanCheckCloudService,                                              //云服检验
  chuGuanUserCloudService,                                               //云服用户
  chuGuanMakeCloudService,                                               //云服制造
  chuGuanRegulatorCloudService,                                          //云服监管

  // 空白跳转页面
  {path:'/reload:to',name:'reload',component:()=>import('@/views/modules/qiping/ReloadPage/Reload'),hidden:true},
  // 电气柜部分
  dianqiguiDataToCloud, // 数据上云
  dqkgDataTest,
  dianqiguiDataWarehouse, // 数据仓储
  dianqiguiDataEngine, // 数据引擎
  dianqiguiErrorWarning,
  //锅炉部分
  guoluDataToCloud, // 数据上云
  dzglDataTest,
  guoluDataWarehouse, // 数据仓储
  guoluDataEngine, // 数据引擎
 // guoluDataCloudService,
  guolujyjg,
  guolusydw,
  guoluzzdw,
  guolujgbm,

  // // 焦炭塔部分
  ...jjtState,
  { path: '*', redirect: '/404', hidden: true }
]
export default new Router({
  scrollBehavior: () => ({ y: 0 }),                    //定义路由切换时页面如何滚动，返回滚动位置对象信息
  routes: constantRouterMap
})

